package com.qkl.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ExceptionEnum {
    SUCCESS(200, "操作成功"),
    CREATED(201, "资源创建成功"),
    REQUEST_FORMAT(399, "请求格式异常"),
    BAD_REQUEST(400, "请求参数错误"),
    UNAUTHORIZED(401, "未认证"),
    FORBIDDEN(403, "权限不足"),
    NOT_FOUND(404, "资源不存在"),
    METHOD_NOT_ALLOWED(405, "方法不允许"),
    CONFLICT(409, "资源冲突"),
    TOO_MANY_REQUESTS(429, "请求过于频繁"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),
    SERVICE_UNAVAILABLE(503, "服务不可用请稍后再试"),


    // 认证与授权相关 (1000系列)
    INVALID_TOKEN(1001, "令牌无效"),
    EXPIRED_TOKEN(1002, "令牌过期"),
    REFRESH_TOKEN_INVALID(1003, "刷新令牌无效"),
    TOKEN_BLACKLISTED(1004, "令牌验证失败"),
    INSUFFICIENT_PERMISSIONS(1005, "权限不足"),
    ACCOUNT_LOCKED(1006, "账户已被锁定"),
    ACCOUNT_DISABLED(1007, "账户已被禁用"),
    LOGIN_FAILED(1008, "用户或者密码错误"),
    CAPTCHA_INVALID(1009, "验证码无效或已过期"),
    DATA_VALIDATION_FAILED(3005, "数据验证失败"),
    // 用户相关 (2000系列)
    USER_NOT_FOUND(2001, "用户不存在"),
    USERNAME_ALREADY_EXISTS(2002, "用户名已存在"),
    EMAIL_ALREADY_EXISTS(2003, "邮箱已被注册"),
    PHONE_ALREADY_EXISTS(2004, "手机号已被注册"),
    REGISTER_FAIL(2004, "注册失败"),
    SAME_PROBLEM(2010, "二个问题不能一样"),
    PROBLEM_ONE_EXITS(2011, "问题1异常"),
    PROBLEM_TWO_EXITS(2012, "问题2异常"),
    INVITE_NOT_FOUND(2013, "邀请码不存在"),
    PASSWORD_AND_PASSWORD(2005, "登录密码不一致"),
    TRADPASSWORD_AND_TRADPASSWORD(2008, "交易密码不一致"),
    FILE_INCORRECT_FORMAT(2010, "上传文件格式不正确"),
    FILE_NOT_EMPTY(2009, "上传文件不能为空"),
    FILE_NOT_FAIL(2011, "文件上传失败"),
    CREATE_DIRECTORY_FAIL(2012, "创建存储目录失败"),
    ADDRESS_ALREADY_EXISTS(2013, "地址已绑定"),
    ADDRESS_NOT_EXISTS(2014, "请输入地址"),
    ONE_OR_TWO_ANSWER_ERROR(2015, "第一个答案或者第二个答案错误"),
    NO_UPDATE_OPERATION(2015, "无修改操作"),
    ;
    private final int code;
    private final String msg;
}
